<template lang="pug">
div
  .ui.grid
    .ten.wide.column(v-if="report.category === 'pq'")
      .ui.header 基本信息
      table.ui.celled.table
        tbody
          tr
            td
              .ui.input.fluid
                input.wide-input(v-model="report.name", placeholder="姓名")
            td.collapsing
              obj-single-select(
                placeholder="性别",
                :options="helper.genderArray",
                key="value",
                label="text",
                :value.sync="report.gender",
                type="value",
              )
            td
              .ui.input.fluid
                input.wide-input(v-model="report.phone", placeholder="手机号")
            td
              date-picker(
                :unix.sync="report.measured_at",
                placeholder="验光时间",
              )
      .ui.header 问诊
      table.ui.celled.table(v-if="report.content")
        tbody
          tr
            td(style="width: 135px;")
              date-picker(
                :unix.sync="report.content['问诊']['出生年月']",
                type="date",
                placeholder="出生年月",
              )
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['问诊']['职业']", placeholder="职业")
            td
              .flex.js.ac
                label(style="margin: 0 5px;") 经常开车
                input#drive-often-true(type='radio', :value='true', v-model="report.content['问诊']['经常开车']")
                label(for='drive-often-true', style="margin: 0 5px;") 是
                input#drive-often-false(type='radio', :value='false', v-model="report.content['问诊']['经常开车']")
                label(for='drive-often-false', style="margin: 0 5px;") 否
          tr
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['问诊']['原镜使用时间']", placeholder="原镜使用时间")
            td
              .flex.js.ac
                label(style="margin: 0 5px;") 原镜清晰度
                input#original-lens-sharpness-true(type='radio', :value='true', v-model="report.content['问诊']['原镜清晰度']")
                label(for='original-lens-sharpness-true', style="margin: 0 5px;") 清晰
                input#original-lens-sharpness-false(type='radio', :value='false', v-model="report.content['问诊']['原镜清晰度']")
                label(for='original-lens-sharpness-false', style="margin: 0 5px;") 不清晰
            td
              .flex.js.ac
                label(style="margin: 0 5px;") 佩戴隐形眼镜
                input#wear-contact-lenses-true(type='radio', :value='true', v-model="report.content['问诊']['佩戴隐形眼镜']")
                label(for='wear-contact-lenses-true', style="margin: 0 5px;") 是
                input#wear-contact-lenses-false(type='radio', :value='false', v-model="report.content['问诊']['佩戴隐形眼镜']")
                label(for='wear-contact-lenses-false', style="margin: 0 5px;") 否
          tr
            td(colspan="3")
              relevant-medical-history-tag(
                :selected.sync="report.content['问诊']['相关病史']"
              )
              //-  相关病史: {{report.content['问诊']['相关病史']}}
          tr
            td(colspan="3")
              .ui.input.fluid
                input.wide-input(v-model="report.content['问诊']['用户陈述']", placeholder="用户陈述")
      br
      .ui.grid.equal.width
        .column
          .ui.header 手持电脑验光
        .column
          .ui.grid.equal.width
            .column
              .ui.header 原镜测量
            .column.right.aligned
              | {{report.content['原镜测量']['眼镜类型']}}
              //- input#frame(type="radio", name="test", value="框架眼镜")
              //- label(for="frame")  框架眼镜
              //- input#contact(type="radio", name="test", value="隐形眼镜")
              //- label(for="contact")  隐形眼镜
      table.ui.celled.table
        thead
          tr
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th 光学中心
        tbody
          tr
            td 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['轴位']['右眼']", placeholder="")
            td 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['轴位']['右眼']", placeholder="")
            td(rowspan="2")
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['轴位']['光学中心']", placeholder="")
          tr
            td 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['手持电脑验光']['轴位']['左眼']", placeholder="")
            td 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['原镜测量']['轴位']['左眼']", placeholder="")
      .ui.header 视力和视功能检查
      table.ui.celled.table
        tbody
          tr
            td 瞳距
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td ADD
            td 矫正视力
          tr
            td(rowspan="2")
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['瞳距']", placeholder="")
            td 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['轴位']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['棱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['基底']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['ADD']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['矫正视力']['右眼']", placeholder="")

          tr
            td.border-left 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['轴位']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['棱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['基底']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['ADD']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['矫正视力']['左眼']", placeholder="")
          tr
            td(colspan="4")
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['主视眼']", placeholder="主视眼")
            td(colspan="5")
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['Worth 四点']", placeholder="Worth 四点")
          tr
            td(colspan="4")
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['立体视检查']", placeholder="立体视检查")
            td(colspan="5")
              .ui.input.fluid
                input.wide-input(v-model="report.content['视力和视功能检查']['Amsler 表']", placeholder="Amsler 表")
      .ui.header 验光处方
      table.ui.celled.table
        tbody
          tr
            td(rowspan="3") 远用
              br
              | 处方
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td 矫正视力
            td 瞳距
          tr
            td.border-left 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['轴位']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['棱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['基底']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['矫正视力']['右眼']", placeholder="")
            td(rowspan="2")
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['瞳距']", placeholder="")
          tr
            td.border-left 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['轴位']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['棱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['基底']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['远用处方']['矫正视力']['左眼']", placeholder="")
      table.ui.celled.table
        tbody
          tr
            td(rowspan="3") 辅助
              br
              | 处方
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td 矫正视力
            td 瞳距
          tr
            td.border-left 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['轴位']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['棱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['基底']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['矫正视力']['右眼']", placeholder="")
            td(rowspan="2")
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['瞳距']", placeholder="")
          tr
            td.border-left 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['轴位']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['棱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['基底']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['辅助处方']['矫正视力']['左眼']", placeholder="")
      .ui.header 验光师建议
      .ui.segment
        ol.ui.list
          li
            .flex.js.ac
              label(style="margin-right: 15px;") 建议你在以下日期进行视力复查:
              date-picker(
                style="width: 150px;",
                :unix.sync="report.content['验光师建议']['复查日期']",
                type="date",
              )
          li
            .flex.js.ac
              label(style="margin-right: 15px;")  根据国际标准, 本次验光处方, 双眼矫正视力达到
              .ui.input
                  input.wide-input(v-model="report.content['验光师建议']['双眼矫正视力']", placeholder="")
        input#frameContact(type="checkbox", v-model="report.content['验光师建议']['建议交替佩戴']")
        label(for="frameContact")  建议隐形眼镜和框架眼镜交替佩戴
        .ui.divider
        .ui.form
          .field
            textarea.wide-input(v-model="report.content['验光师建议']['补充']", placeholder="补充")
      table.ui.celled.table
        tbody
          tr
            td
              .ui.input.fluid
                input.wide-input(type='text', placeholder="验光师", v-model="report.optometrist_name")
            td
              date-picker(
                :unix.sync="report.measured_at",
                placeholder="验光时间",
              )
          tr
            td
              .ui.input.fluid
                input.wide-input(type='text', placeholder='录入人', v-model="report.inputer_name")
            td {{report.inputed_at|unixToDate}}
              //- date-picker(
              //-   :unix.sync="report.inputed_at",
              //-   placeholder="录入时间",
              //- )
          tr
            td
              .ui.input.fluid
                input.wide-input(type='text', placeholder='核对人', v-model="report.reviewer_name")
            td {{report.reviewed_at|unixToDate}}
              //- date-picker(
              //-   :unix.sync="report.reviewed_at",
              //-   placeholder="核对时间",
              //- )
    .ten.wide.column(v-if="report.category === 'user'")
      .ui.header 基本信息
      table.ui.celled.table
        tbody
          tr
            td
              .ui.input.fluid
                input.wide-input(v-model="report.name", placeholder="姓名")
            td.collapsing
              obj-single-select(
                placeholder="性别",
                :options="helper.genderArray",
                key="value",
                label="text",
                :value.sync="report.gender",
                type="value",
              )
            td
              .ui.input.fluid
                input.wide-input(v-model="report.phone", placeholder="手机号")
            td 上传时间: {{report.created_at | unixToDate}}
      .ui.header 验光处方
      table.ui.celled.table
        thead
          tr
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th 矫正视力
            th 瞳距
        tbody
          tr
            td 右眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['球镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['柱镜']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['轴位']['右眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['矫正视力']['右眼']", placeholder="")
            td(rowspan="2")
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['瞳距']", placeholder="")
          tr
            td 左眼
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['球镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['柱镜']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['轴位']['左眼']", placeholder="")
            td
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['矫正视力']['左眼']", placeholder="")
          tr
            td.no-border-right Add
            td.no-border-left
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['Add']", placeholder="")
            td.no-border-right 棱镜
            td.no-border-left
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['棱镜']", placeholder="")
            td.no-border-right 基底
            td.no-border-left
              .ui.input.fluid
                input.wide-input(v-model="report.content['验光处方']['基底']", placeholder="")
      table.ui.celled.table
        tbody
          tr
            td
              .ui.input.fluid
                input.wide-input(type='text', placeholder='录入人', v-model="report.inputer_name")
            td {{report.inputed_at | unixToDate 'YYYY-MM-DD HH:mm:ss'}}
              //- date-picker(
              //-   :unix.sync="report.inputed_at",
              //-   placeholder="录入时间",
              //- )
          tr
            td
              .ui.input.fluid
                input.wide-input(type='text', placeholder='核对人', v-model="report.reviewer_name")
            td {{report.reviewed_at | unixToDate 'YYYY-MM-DD HH:mm:ss'}}
              //- date-picker(
              //-   :unix.sync="report.reviewed_at",
              //-   placeholder="核对时间",
              //- )
    .six.wide.column
      img-upload(style="width: 100%;", v-bind:src.sync='report.scan_picture')
</template>

<script>
import imgUpload from '../../modules/upload/img'
import ObjSingleSelect from '../../modules/select/objSingle'
import ArraySingleSelect from '../../modules/select/arraySingle'
import RelevantMedicalHistoryTag from '../../modules/tag/relevantMedicalHistory'
import DatePicker from '../../modules/date'

export default {
  name: 'reportEdit',
  components: {
    ObjSingleSelect,
    ArraySingleSelect,
    imgUpload,
    DatePicker,
    RelevantMedicalHistoryTag,
  },
  props: ['report'],
  vuex: {
    getters: {
    },
    actions: {}
  },
  data() {
    return {
    }
  },
  computed: {
  },
  methods: {
  },
  ready() {
    $(this.$el).find('.dropdown').dropdown({
      on: 'hover'
    })
  },
}
</script>

<style lang="sass" scoped>
</style>
